#pragma once
#include "include/views/cef_window.h"
#include "include/views/cef_browser_view.h"

class WindowDelegate : public CefWindowDelegate
{
public:
	explicit WindowDelegate(CefRefPtr<CefBrowserView> browser_view, bool dev_tool) : browser_view_(browser_view), m_IsDevTool(dev_tool){}
	// frameless window, mask the system default title bar
	bool IsFrameless(CefRefPtr<CefWindow> window) override;
	void OnWindowCreated(CefRefPtr<CefWindow> window) override;
	void OnWindowDestroyed(CefRefPtr<CefWindow> window) override;
	bool CanClose(CefRefPtr<CefWindow> window) override;
	CefRect GetInitialBounds(CefRefPtr<CefWindow> window) override;
	WindowDelegate(const WindowDelegate&) = delete;
	WindowDelegate operator=(const WindowDelegate&) = delete;

private:
	bool m_IsDevTool;
	CefRefPtr<CefBrowserView> browser_view_;
	IMPLEMENT_REFCOUNTING(WindowDelegate);
};

